package com.dgw.router;

import com.dgw.Beans.HelloHandle;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.server.*;

/**
 * @program: spring-boot-webflux
 * @description:
 * @author: Mr.Dai
 * @create: 2019-11-26 20:47
 **/
@Configuration
public class HelloRouter {

    @Bean
    public RouterFunction<ServerResponse> routerHello(){
        return RouterFunctions.route(RequestPredicates.GET("/hello")
        .and(RequestPredicates.accept(MediaType.APPLICATION_PROBLEM_JSON)),
                HelloHandle::hello);
    }
}
